﻿using Smobiler.Core;
using Smobiler.Core.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FubiManger.UI;

namespace FubiManger.Controls
{
    ////ToolboxItem用于控制是否添加自定义控件到工具箱，true添加，false不添加
    //[System.ComponentModel.ToolboxItem(true)]
    partial class Prodouctcontrol : Smobiler.Core.Controls.MobileUserControl
    {
        public Prodouctcontrol() : base()
        {
            //This call is required by the SmobilerUserControl.
            InitializeComponent();
        }
        /// <summary>
        /// 封面
        /// </summary>
        public string cover { get; set; }
        /// <summary>
        /// 商品名
        /// </summary>
        public string gdname { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string describes { get; set; }
        /// <summary>
        /// 市场价
        /// </summary>
        public string market_price { get; set; }
        /// <summary>
        /// 销售价
        /// </summary>
        public double price { get; set; }
        /// <summary>
        /// 商品ID
        /// </summary>
        public string gdid { get; set; }
        /// <summary>
        /// 1预览2点餐3加单
        /// </summary>
        public string stype { get; set; }
        private void panadd_Press(object sender, EventArgs e)
        {
            if (stype == "2")
                ((OrderfoodForm)this.Form).Addpro(lblname.Text, cover, price, 1);//添加商品入购物车
            else
                ((AddfoodForm)this.Form).Addpro(lblname.Text, cover, price, 1);//添加商品入购物车
        }

        private void paninfo_Press(object sender, EventArgs e)
        {

        }

        private void Prodouctcontrol_Load(object sender, EventArgs e)
        {
            lblname.Text = gdname;//商品名称
            lblmoney.Text = price + "  ";//销售价
            lblbmoney.Text = market_price;//市场价
            lbldes.Text = describes;//描述
            imgcover.ResourceID = @"c:\fbimage\" + cover;//封面
            if (stype != "1")
                panadd.Visible = true;
        }
    }
}